<template>
  <div
    class="btn"
    :class="{
      success: type == 'success',
      danger: type == 'danger',
      primmary: type == 'primmary',
    }"
    @click="handle"
  >
    <span class="icon"></span>
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: {
    type: {
      type: String,
    },
  },
  methods: {
    handle(e) {
      this.$emit("click", e);
    },
  },
};
</script>
<style lang='less' scoped>
.btn {
  width: 318 * 100vw/360;
  height: 50px;
  //   background-color: rgb(70, 158, 12);
  border-radius: 25px;
  line-height: 50px;
  text-align: center;
  //   color: #fff;
  font-weight: bold;
  font-size: 20px;
}
.success {
  background-color: rgb(70, 158, 12);
  color: #fff;
}
.danger {
  background-color: rgb(247, 244, 64);
  color: #fff;
}
.primmary {
  background-color: rgb(230, 56, 12);
  color: #fff;
}
</style>
